<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/samples.css">
<title></title>
<script type="text/javascript">
var audioFormats = [
    'audio/32kadpcm',
	'audio/3gpp',
	'audio/3gpp2',
	'audio/ac3',
	'audio/adpcm',
	'audio/amr',
	'audio/amr-wb',
	'audio/amr-wb+',
	'audio/asc',
	'audio/basic',
	'audio/bv16',
	'audio/bv32',
	'audio/clearmode',
	'audio/cn',
	'audio/dat12',
	'audio/dls',
	'audio/dsr-es201108',
	'audio/dsr-es202050',
	'audio/dsr-es202211',
	'audio/dsr-es202212',
	'audio/dvi4',
	'audio/eac3',
	'audio/evrc',
	'audio/evrc-qcp',
	'audio/evrc0',
	'audio/evrc1',
	'audio/evrcb',
	'audio/evrcb0',
	'audio/evrcb1',
	'audio/evrcwb',
	'audio/evrcwb0',
	'audio/evrcwb1',
	'audio/example',
	'audio/g719',
	'audio/g722',
	'audio/g7221',
	'audio/g723',
	'audio/g726-16',
	'audio/g726-24',
	'audio/g726-32',
	'audio/g726-40',
	'audio/g728',
	'audio/g729',
	'audio/g7291',
	'audio/g729d',
	'audio/g729e',
	'audio/gsm',
	'audio/gsm-efr',
	'audio/ilbc',
	'audio/l16',
	'audio/l20',
	'audio/l24',
	'audio/l8',
	'audio/lpc',
	'audio/midi',
	'audio/mobile-xmf',
	'audio/mp4',
	'audio/mp4a-latm',
	'audio/mpa',
	'audio/mpa-robust',
	'audio/mpeg',
	'audio/mpeg4-generic',
	'audio/ogg',
	'audio/parityfec',
	'audio/pcma',
	'audio/pcma-wb',
	'audio/pcmu-wb',
	'audio/pcmu',
	'audio/prs.sid',
	'audio/qcelp',
	'audio/red',
	'audio/rtp-enc-aescm128',
	'audio/rtp-midi',
	'audio/rtx',
	'audio/smv',
	'audio/smv0',
	'audio/smv-qcp',
	'audio/sp-midi',
	'audio/t140c',
	'audio/t38',
	'audio/telephone-event',
	'audio/tone',
	'audio/ulpfec',
	'audio/vdvi',
	'audio/vmr-wb',
	'audio/vnd.3gpp.iufp',
	'audio/vnd.4sb',
	'audio/vnd.audiokoz',
	'audio/vnd.celp',
	'audio/vnd.cisco.nse',
	'audio/vnd.cmles.radio-events',
	'audio/vnd.cns.anp1',
	'audio/vnd.cns.inf1',
	'audio/vnd.digital-winds',
	'audio/vnd.dlna.adts',
	'audio/vnd.dolby.heaac.1',
	'audio/vnd.dolby.heaac.2',
	'audio/vnd.dolby.mlp',
	'audio/vnd.dolby.mps',
	'audio/vnd.dolby.pl2',
	'audio/vnd.dolby.pl2x',
	'audio/vnd.dolby.pl2z',
	'audio/vnd.dts',
	'audio/vnd.dts.hd',
	'audio/vnd.everad.plj',
	'audio/vnd.hns.audio',
	'audio/vnd.lucent.voice',
	'audio/vnd.ms-playready.media.pya',
	'audio/vnd.nokia.mobile-xmf',
	'audio/vnd.nortel.vbk',
	'audio/vnd.nuera.ecelp4800',
	'audio/vnd.nuera.ecelp7470',
	'audio/vnd.nuera.ecelp9600',
	'audio/vnd.octel.sbc',
	'audio/vnd.qcelp',
	'audio/vnd.rhetorex.32kadpcm',
	'audio/vnd.sealedmedia.softseal.mpeg',
	'audio/vnd.vmx.cvsd',
	'audio/vorbis',
	'audio/vorbis-config',
	'audio/x-aac',
	'audio/x-aiff',
	'audio/x-mpegurl',
	'audio/x-ms-wax',
	'audio/x-ms-wma',
	'audio/x-pn-realaudio',
	'audio/x-pn-realaudio-plugin',
	'audio/x-wav',
];
var videoFormats = [
    'application/vnd.rn-realmedia',
	'video/3gpp',
	'video/3gpp-tt',
	'video/3gpp2',
	'video/bmpeg',
	'video/bt656',
	'video/celb',
	'video/dv',
	'video/example',
	'video/h261',
	'video/h263',
	'video/h263-1998',
	'video/h263-2000',
	'video/h264',
	'video/jpeg',
	'video/jpeg2000',
	'video/jpm',
	'video/mj2',
	'video/mp1s',
	'video/mp2p',
	'video/mp2t',
	'video/mp4',
	'video/mp4v-es',
	'video/mpeg',
	'video/mpeg4-generic',
	'video/mpv',
	'video/nv',
	'video/ogg',
	'video/parityfec',
	'video/pointer',
	'video/quicktime',
	'video/raw',
	'video/rtp-enc-aescm128',
	'video/rtx',
	'video/smpte292m',
	'video/ulpfec',
	'video/vc1',
	'video/vnd.cctv',
	'video/vnd.dlna.mpeg-tts',
	'video/vnd.fvt',
	'video/vnd.hns.video',
	'video/vnd.iptvforum.1dparityfec-1010',
	'video/vnd.iptvforum.1dparityfec-2005',
	'video/vnd.iptvforum.2dparityfec-1010',
	'video/vnd.iptvforum.2dparityfec-2005',
	'video/vnd.iptvforum.ttsavc',
	'video/vnd.iptvforum.ttsmpeg2',
	'video/vnd.motorola.video',
	'video/vnd.motorola.videop',
	'video/vnd.mpegurl',
	'video/vnd.ms-playready.media.pyv',
	'video/vnd.nokia.interleaved-multimedia',
	'video/vnd.nokia.videovoip',
	'video/vnd.objectvideo',
	'video/vnd.sealed.mpeg1',
	'video/vnd.sealed.mpeg4',
	'video/vnd.sealed.swf',
	'video/vnd.sealedmedia.softseal.mov',
	'video/vnd.vivo',
	'video/x-f4v',
	'video/x-fli',
	'video/x-flv',
	'video/x-m4v',
	'video/x-matroska',
	'video/x-ms-asf',
	'video/x-ms-wm',
	'video/x-ms-wmv',
	'video/x-ms-wmx',
	'video/x-ms-wvx',
	'video/x-msvideo',
	'video/x-sgi-movie',
];
var audioCodecs = [
	'ac-3',
	'alac',
	'dra1',
	'dtsc',
	'dtsh',
	'dtsl',
	'ec-3',
	'enca',
	'g719',
	'g726',
	'mp4a',
	'raw$20',
	'samr',
	'sawb',
	'sawp',
	'sevc',
	'sqcp',
	'ssmv',
	'twos',
    'vorbis',
    'speex'
];
var videoCodecs = [
	'avc1',
	'avcp',
	'drac',
	'encv',
	'mjp2',
	'mp4v',
	's263',
	'vc-1',
    'theora',
    'flv1',
    'flv4',
    'flv5'
];
var audio, video;
function check() {
  audio = document.getElementById("audio1");
  audio.addEventListener("error", onPlayError, false);
  video = document.getElementById("video1");
  video.addEventListener("error", onPlayError, false);

  var supported = "", unsupported = "";
  for (var i = 0; i < audioFormats.length; i++) {
    var status = audio.canPlayType(audioFormats[i]);
    if (status == "maybe" || status == "probably") {
      if (status == "maybe")
        supported += "<div style='color: black;'>[" + audioFormats[i] + "] may be supported format.</div>";
	  else
		supported += "<div style='color: green;'>[" + audioFormats[i] + "] may be supported format.</div>";
	  supported += "<ol>";
	  for (var j = 0; j < audioCodecs.length; j++) {
		var type = audioFormats[i] + "; codecs=\"" + audioCodecs[j] + "\""
	    if (video.canPlayType(type) == "probably") {
		  supported += "<li style='color: green;'>[" + type + "] is supported format!! (probably)</li>";
		}
	  }
	  supported += "</ol>";
    } else {
	  unsupported += "<div style='color: red;'>[" + audioFormats[i] + "] is not supported format...</div>";
	}
  }
  for (var i = 0; i < videoFormats.length; i++) {
    var status = video.canPlayType(videoFormats[i]);
    if (status == "maybe" || status == "probably") {
      if (status == "maybe")
        supported += "<div style='color: black;'>[" + videoFormats[i] + "] may be supported format.</div>";
	  else
		supported += "<div style='color: green;'>[" + videoFormats[i] + "] may be supported format.</div>";
	  supported += "<ol>";
	  for (var j = 0; j < videoCodecs.length; j++) {
		var type = videoFormats[i] + "; codecs=\"" + videoCodecs[j] + "\""
	    if (video.canPlayType(type) == "probably") {
		  supported += "<li style='color: green;'>[" + type + "] is supported format!! (probably)</li>";
		}
	  }
	  supported += "</ol>";
    } else {
	  unsupported += "<div style='color: red;'>[" + videoFormats[i] + "] is not supported format...</div>";
	}
  }
  document.getElementById("supported").innerHTML += supported;
  document.getElementById("unsupported").innerHTML += unsupported;
}
function playAudio() {
  var mediaDataURL = document.getElementById("audioURL").value;
  if (mediaDataURL.length > 0) {
    audio.src = mediaDataURL;
	audio.load();
  }
}
function playVideo() {
  var mediaDataURL = document.getElementById("videoURL").value;
  if (mediaDataURL.length > 0) {
    video.src = mediaDataURL;
	video.load();
  }
}
function onPlayError(event) {
  switch (this.error.code) {
	case 4:
	  alert("Unsupported media type");
	  break;
	case 3:
	  alert("Decode error");
	  break;
	case 2:
	  alert("Network error");
	  break;
  }
}
</script>
</head>
<body onload="check()">
  <div class="header">
  <a target="ayuta" href="http://ayuta.co.jp">株式会社あゆた</a>
  </div>

	  <div>

<audio id="audio1" controls>
</audio><br/>
Audio data's URL:<input id="audioURL" type="text"><button onclick="playAudio()">Play</button>
</div>
<div>
<video id="video1" controls loop autoplay>
  このページは、videoタグをサポートしたブラウザで見る必要があります。
</video><br/>
Video data's URL:<input id="videoURL" type="text"><button onclick="playVideo()">Play</button>
</div>
<hr>
<div id="supported">
  <h2>Supported Formats/Codecs</h2>
</div>
<div id="unsupported">
  <h2>Unsupported Formats</h2>
</div>
		<!-- Google Analytics Setting -->
		<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
		</script>
  <script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10177692-1");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>
